package common.packets;

/**
 * Client recieve this packet as a result of login action
 * @author mickek
 *
 */
public class LoginResultPacket extends Packet {

	public static final String PREFIX = "login_result";

	public static final int LOGIN_OK = 0x01;
	public static final int LOGIN_INCORRECT = 0x02;
	
	private int result = 0x01;

	public LoginResultPacket( int _result ) {
		result  = _result;
	}
	
	public int getResult(){
		return result;
	}
	
	@Override
	public byte[] serialize() {
		return (PREFIX + Packet.DELIMITER + result + Packet.DELIMITER + Packet.NEW_LINE ).getBytes();
	}

	@Override
	public String toString() {
		return PREFIX;
	}
}
